package delysoft;

import com.tesis2.pucp.Modelo.TesisUsuario;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.util.Date;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 *
 * @author katy
 */
public class MainMenuGUI extends javax.swing.JFrame {

   
    /**
     * Creates new form testPerfilGUI
     */
    public MainMenuGUI() {
        initComponents();
        setLocationRelativeTo(null);
        
    }

    public void llenarPanelInfo(TesisUsuario usr){
        lblNombre.setText(usr.getNombre() + " " +usr.getApellidopaterno() + " " + usr.getApellidomaterno());
        lblCiudad.setText("Lima");
        lblFecha.setText((new Date()).toString());
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem22 = new javax.swing.JMenuItem();
        jMenuItem23 = new javax.swing.JMenuItem();
        sesionPanel = new javax.swing.JPanel();
        btnSalir = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        lblNombre = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lblFecha = new javax.swing.JLabel();
        lblCiudad = new javax.swing.JLabel();
        test = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jmSeguridad = new javax.swing.JMenu();
        jmPerfil = new javax.swing.JMenuItem();
        jmUsuario = new javax.swing.JMenuItem();
        jmEnvios = new javax.swing.JMenu();
        jmVehiculos = new javax.swing.JMenuItem();
        jmTurno = new javax.swing.JMenuItem();
        jmCliente = new javax.swing.JMenuItem();
        jmProducto = new javax.swing.JMenuItem();
        jmAlmacen = new javax.swing.JMenuItem();
        jmPedidos = new javax.swing.JMenuItem();
        jmSimulacion = new javax.swing.JMenu();
        jmSimulador = new javax.swing.JMenuItem();

        jMenuItem2.setText("jMenuItem2");

        jMenu3.setText("jMenu3");

        jMenu4.setText("jMenu4");

        jMenu2.setText("jMenu2");

        jMenuItem1.setText("jMenuItem1");

        jMenuItem3.setText("jMenuItem3");

        jMenuItem10.setText("jMenuItem10");

        jMenuItem22.setText("jMenuItem22");

        jMenuItem23.setText("jMenuItem23");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        sesionPanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        sesionPanel.setMaximumSize(new java.awt.Dimension(32767, 700));
        sesionPanel.setMinimumSize(new java.awt.Dimension(0, 700));
        sesionPanel.setPreferredSize(new java.awt.Dimension(165, 700));

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });

        jLabel1.setText("Usuario : ");

        lblNombre.setText("-------");

        jLabel3.setText("Ciudad: ");

        jLabel5.setText("Hora: ");

        lblFecha.setText("--/--/----");

        lblCiudad.setText("-------");

        javax.swing.GroupLayout sesionPanelLayout = new javax.swing.GroupLayout(sesionPanel);
        sesionPanel.setLayout(sesionPanelLayout);
        sesionPanelLayout.setHorizontalGroup(
            sesionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sesionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(sesionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addGroup(sesionPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(btnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel1)
                    .addComponent(lblNombre)
                    .addComponent(jLabel3)
                    .addComponent(lblCiudad)
                    .addComponent(lblFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 25, Short.MAX_VALUE))
        );
        sesionPanelLayout.setVerticalGroup(
            sesionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sesionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblNombre)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblCiudad)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblFecha)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnSalir)
                .addGap(38, 38, 38))
        );

        test.setMaximumSize(new java.awt.Dimension(700, 700));
        test.setMinimumSize(new java.awt.Dimension(700, 700));
        test.setOpaque(false);

        javax.swing.GroupLayout testLayout = new javax.swing.GroupLayout(test);
        test.setLayout(testLayout);
        testLayout.setHorizontalGroup(
            testLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 701, Short.MAX_VALUE)
        );
        testLayout.setVerticalGroup(
            testLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 700, Short.MAX_VALUE)
        );

        jmSeguridad.setText("Seguridad");

        jmPerfil.setText("Perfiles");
        jmPerfil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmPerfilActionPerformed(evt);
            }
        });
        jmSeguridad.add(jmPerfil);

        jmUsuario.setText("Usuarios");
        jmSeguridad.add(jmUsuario);

        jMenuBar1.add(jmSeguridad);

        jmEnvios.setText("Envíos");

        jmVehiculos.setText("Vehiculos");
        jmVehiculos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmVehiculosActionPerformed(evt);
            }
        });
        jmEnvios.add(jmVehiculos);

        jmTurno.setText("Turno");
        jmEnvios.add(jmTurno);

        jmCliente.setText("Clientes");
        jmEnvios.add(jmCliente);

        jmProducto.setText("Productos");
        jmEnvios.add(jmProducto);

        jmAlmacen.setText("Almacenes");
        jmAlmacen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmAlmacenActionPerformed(evt);
            }
        });
        jmEnvios.add(jmAlmacen);

        jmPedidos.setText("Pedidos");
        jmEnvios.add(jmPedidos);

        jMenuBar1.add(jmEnvios);

        jmSimulacion.setText("Simulación");

        jmSimulador.setText("Simulador");
        jmSimulacion.add(jmSimulador);

        jMenuBar1.add(jmSimulacion);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(test, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(sesionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(test, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(sesionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(56, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed

    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jmVehiculosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmVehiculosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmVehiculosActionPerformed

    private void jmPerfilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmPerfilActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmPerfilActionPerformed

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnSalirActionPerformed

    private void jmAlmacenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmAlmacenActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jmAlmacenActionPerformed

    
    
    public void addBuscarPedidosMenutItem(ActionListener listener) { this.jmPedidos.addActionListener(listener); }
        
    public void addBuscarUsuarioMenutItem(ActionListener listener) { this.jmUsuario.addActionListener(listener); }
        
    public void addMostrarSimulacionMapaMenutItem(ActionListener listener) { this.jmSimulador.addActionListener(listener); }
           
    public void addMostrarVehiculosMenuItem(ActionListener listener) { this.jmVehiculos.addActionListener(listener); }
        
    public void addBuscarPerfilMenuItem(ActionListener listener) { this.jmPerfil.addActionListener(listener); }  
         
    public void addBuscarClienteMenuItem(ActionListener listener) { this.jmCliente.addActionListener(listener); }                                      
     
    public void addBuscarAlmacenMenuItem(ActionListener listener) { this.jmAlmacen.addActionListener(listener); } 
    
    public void addBuscarTurnosMenuItem(ActionListener listener) { this.jmTurno.addActionListener(listener); } 
    
    public void addBuscarProductosMenuItem(ActionListener listener) { this.jmProducto.addActionListener(listener); } 
    
    public void addSalirListener(ActionListener ml){
        this.btnSalir.addActionListener(ml);
    }
              
    public void setCurrentPanel(Component p)
    {
        this.getContentPane().removeAll();
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(p, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(sesionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(sesionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 663, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(p, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }
    
    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("GTK+".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(MainMenuGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {    
//                //MainMenuGUI sigepaMain = new MainMenuGUI();
//                //MainController mainController = new MainController(sigepaMain);
//                //sigepaMain.setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem22;
    private javax.swing.JMenuItem jMenuItem23;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jmAlmacen;
    private javax.swing.JMenuItem jmCliente;
    private javax.swing.JMenu jmEnvios;
    private javax.swing.JMenuItem jmPedidos;
    private javax.swing.JMenuItem jmPerfil;
    private javax.swing.JMenuItem jmProducto;
    private javax.swing.JMenu jmSeguridad;
    private javax.swing.JMenu jmSimulacion;
    private javax.swing.JMenuItem jmSimulador;
    private javax.swing.JMenuItem jmTurno;
    private javax.swing.JMenuItem jmUsuario;
    private javax.swing.JMenuItem jmVehiculos;
    private javax.swing.JLabel lblCiudad;
    private javax.swing.JLabel lblFecha;
    private javax.swing.JLabel lblNombre;
    private javax.swing.JPanel sesionPanel;
    private javax.swing.JPanel test;
    // End of variables declaration//GEN-END:variables
}
